import request from '@/utils/request'
export default {

  /** ************************************************销售订单 主表  **************************/
  // 新增
  create: data => {
    return request({
      url: `/salesOrder/add`,
      method: 'post',
      data
    })
  },
  // 分页条件查询
  getList: data => {
    return request({
      url: `/salesOrder/findAll`,
      method: 'post',
      data
    })
  },
  // 根据id查询
  findById: params => {
    return request({
      url: `/salesOrder/findById`,
      method: 'get',
      params
    })
  },

  // 修改
  modify: (id, data) => {
    return request({
      url: `/salesOrder/update/${id}`,
      method: 'put',
      data
    })
  },
  // 批量删除
  mulDelete: data => {
    return request({
      url: `/salesOrder/deleteBatch`,
      method: 'delete',
      data
    })
  },

  /** ************************************************从表 产品标准  **************************/

  // 新增产品规范标准叙述
  createChild: data => {
    return request({
      url: `/salesOrderSubItem/add`,
      method: 'post',
      data
    })
  },
  // 分页条件查询
  getChildList: data => {
    return request({
      url: `/salesOrderSubItem/findAll`,
      method: 'post',
      data
    })
  },
  // 修改产品规范基本信息
  modifyChild: (id, data) => {
    return request({
      url: `/salesOrderSubItem/update/${id}`,
      method: 'put',
      data
    })
  },
  // 根据id查询
  findChildById: params => {
    return request({
      url: `/salesOrderSubItem/findById`,
      method: 'get',
      params
    })
  },
  // 批量删除
  mulDeleteChild: data => {
    return request({
      url: `/salesOrderSubItem/deleteBatch`,
      method: 'delete',
      data
    })
  }
}
